﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Caching;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AJAX_learning.Chapter11
{
	public partial class p4 : System.Web.UI.Page
	{
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);

			Cache["Key1"] = "Cache Item 1";
			// Сделать Cache["Key2"] зависящим от Cache["Key1"].
			var dependencyKey = new string[1];
			dependencyKey[0] = "Key1";
			var dependency = new CacheDependency(null, dependencyKey);
			Cache.Insert("Key2", "Cache Item 2", dependency);
			this.Cache["Key1"] = "New Item 1";
		}

	}
}